package com.mingtu.jgspatrol.activity;

import android.os.Bundle;
import android.view.View;

import com.mingtu.common.utils.IntentUtils;
import com.mingtu.jgspatrol.R;
import com.mingtu.jgspatrol.adapter.ReportTypedAdapter;
import com.mingtu.jgspatrol.base.MyBaseActivity;
import com.mingtu.jgspatrol.databinding.ActivityUploadBinding;

public class ReportTypeActivity extends MyBaseActivity<ActivityUploadBinding> {

    @Override
    protected int getLayoutId() {
        return R.layout.activity_upload;
    }

    @Override
    protected void initView() {
        setModuleTitle("上报");
        super.initView();
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void getData() {
        ReportTypedAdapter reportTypedAdapter = new ReportTypedAdapter(context);
        binding.gridView.setAdapter(reportTypedAdapter);
        reportTypedAdapter.setOnItemClickListener(new ReportTypedAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(View view, int position) {
                if (position == 0) {//正常巡护
                    Bundle bundle1 = new Bundle();
                    bundle1.putInt("uploadType", 1);
                    IntentUtils.getInstance().readyGo(ReportTypeActivity.this, ReportedEventActivity.class, bundle1);
                } else if (position == 1) {//紧急事件
                    Bundle bundle4 = new Bundle();
                    bundle4.putInt("uploadType", 4);
                    IntentUtils.getInstance().readyGo(ReportTypeActivity.this, ReportedEventActivity.class, bundle4);
                } else if (position == 2) {//异常行为
                    Bundle bundle2 = new Bundle();
                    bundle2.putInt("uploadType", 2);
                    IntentUtils.getInstance().readyGo(ReportTypeActivity.this, ReportedEventActivity.class, bundle2);
                } else if (position == 3) {//疫源疫病
                    Bundle bundle3 = new Bundle();
                    bundle3.putInt("uploadType", 3);
                    IntentUtils.getInstance().readyGo(ReportTypeActivity.this, ReportedEventActivity.class, bundle3);
                }
            }
        });
    }

}